// src/composables/useRepoDialog.ts
import { ref } from 'vue';

interface KnowledgeRepo {
  title: string;
  description: string;
}

export default function useRepoDialog() {
  const dialogVisible = ref(false);
  const form = ref<KnowledgeRepo>({ title: '', description: '' });
  const formLabelWidth = '80px';

  function openDialog() {
    dialogVisible.value = true;
  }

  function closeDialog() {
    dialogVisible.value = false;
  }

  function resetForm() {
    form.value = { title: '', description: '' };
  }

  return { dialogVisible, form, openDialog, closeDialog, formLabelWidth, resetForm };
}